home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Palettes / PSAction / palette.make < prev    next >
Text File  |  1995-06-12  |  5KB  |  144 lines

  1. #
  2. #                               palette.make
  3. #
  4. # Inputs from Makefile.preamble (no defaults):
  5. #    OTHER_CFLAGS - Flags passed to compiler (in addition to -g, -O, etc.)
  6. #    PALETTELDFLAGS - Additional flags passed to ld when linking palettes
  7. #    OTHER_LDFLAGS - Flags passed to ld (in addition to -ObjC, etc.)
  8. #    OTHER_OFILES - Additional relocatables that may be linked in
  9. #    OTHER_PRODUCT_DEPENDS - Other dependencies of this project
  10. #    OTHER_SOURCEFILES - Other source files maintained by .pre/postamble
  11. #    OTHER_GARBAGE - Additional files to be removed by make 'clean' 
  12. #    PRECOMPS - Precompiled headers that should be built before compilation 
  13. #    OTHER_INITIAL_TARGETS - Targets to be built before subprojects, etc.
  14. #
  15. #    MSGFILES - .msg files that should have msgwrap run on them
  16. #    DEFSFILES - .defs files that should have mig run on them
  17. #    MIGFILES - .mig files (no .defs files) that should have mig run on them
  18. #
  19. #    DSTROOT - Virtual root directory prepended to $(INSTALLDIR)
  20. #
  21. # Inputs from Makefile.preamble (with defaults set here or in common.make):
  22. #    NORMAL_CFLAGS - Flags passed to compiler in normal compiles
  23. #    MAKEFILES - Makefiles this project depends on (default = Makefile)
  24. #    DEFAULT_CFLAGS - All compiler flags for this level (default set below)
  25. #
  26. # Inputs from Makefile (avoid setting these, ProjectBuilder controls them):
  27. #    NAME - name of application
  28. #    LANGUAGE - langage in which the project is written (default "English")
  29. #    LOCAL_RESOURCES - localized resources (e.g. nib's, images) of project
  30. #    GLOBAL_RESOURCES - non-localized resources of project
  31. #
  32. #    CLASSES - Class implementation files in project.
  33. #    HFILES - Header files in project.
  34. #    MFILES - Other Objective-C source files in project. 
  35. #    CFILES - Other C source files in project. 
  36. #    PSWFILES - .psw files in the project
  37. #    PSWMFILES - .pswm files in the project
  38. #    SUBPROJECTS - Subprojects of this project
  39. #    BUNDLES - Bundle subprojects of this project
  40. #    OTHERSRCS - Other miscellaneous sources of this project
  41. #    OTHERLINKED - Source files not matching a standard source extention
  42. #    OTHERLINKEDOFILES - Other relocatable files to (always) link in.
  43. #    APP_MAKEFILE_DIR - Directory in which to find generic set of Makefiles
  44. #    MAKEFILEDIR - Directory in which to find $(MAKEFILE)
  45. #    MAKEFILE - Top level mechanism Makefile (e.g., app.make, bundle.make)
  46.  
  47.  
  48.  
  49. APP_MAKEFILE_DIR = /NextDeveloper/Makefiles/app
  50. include $(APP_MAKEFILE_DIR)/common.make
  51. include $(APP_MAKEFILE_DIR)/specialrules.make
  52.  
  53. all palette:: 
  54.     @($(process_target_archs)_obj ; \
  55.     $(set_bundle_ext) ; \
  56.     if [ "$(ENGLISH)" = "YES" -o "$(JAPANESE)" != "YES" ] ; then \
  57.         language_cflags='' ; \
  58.     else \
  59.         language_cflags='-DKANJI' ; \
  60.     fi ; \
  61.     $(MAKE) project \
  62.         "OFILE_DIR = $(OBJROOT)/$$obj_dir" \
  63.         "PROJ_CFLAGS = $(NORMAL_CFLAGS) $$language_cflags" \
  64.         "MAKEFILEDIR = $(MAKEFILEDIR)" \
  65.         "BUNDLE_EXTENSION = $$bundle_ext" \
  66.         "RC_CFLAGS = $$arch_cflags" \
  67.         "RC_ARCHS = $$archs" \
  68.         "SRCROOT = $(SRCROOT)" \
  69.         "OBJROOT = $(OBJROOT)" \
  70.         "PRODUCT_ROOT = $(SYMROOT)/$(NAME).palette" \
  71.         "SYMROOT = $(SYMROOT)/sym" \
  72.         "SYM_DIR = $(SYMROOT)/sym" )
  73.  
  74. debug::
  75.     @($(process_target_archs)_debug_obj ; \
  76.     $(set_bundle_ext) ; \
  77.     if [ "$(ENGLISH)" = "YES" -o "$(JAPANESE)" != "YES" ] ; then \
  78.         language_cflags='' ; \
  79.     else \
  80.         language_cflags='-DKANJI' ; \
  81.     fi ; \
  82.     $(MAKE) project \
  83.         "OFILE_DIR = $(OBJROOT)/$$obj_dir" \
  84.         "PROJ_CFLAGS = $(DEBUG_CFLAGS) $$language_cflags" \
  85.         "MAKEFILEDIR = $(MAKEFILEDIR)" \
  86.         "BUNDLE_EXTENSION = $$bundle_ext" \
  87.         "RC_CFLAGS = $$arch_cflags" \
  88.         "RC_ARCHS = $$archs" \
  89.         "SRCROOT = $(SRCROOT)" \
  90.         "OBJROOT = $(OBJROOT)" \
  91.         "PRODUCT_ROOT = $(SYMROOT)/$(NAME).palette" \
  92.         "SYMROOT = $(SYMROOT)/sym" \
  93.         "SYM_DIR = $(SYMROOT)/sym" )
  94.  
  95. project:: $(INITIAL_TARGETS) subprojs bundles tools \
  96.     resources $(PRODUCT_ROOT)/$(NAME)
  97.     
  98. $(PRODUCT_ROOT):
  99.     @$(MKDIRS) $(PRODUCT_ROOT)
  100.  
  101. TEMP_C_FILE = $(SYM_DIR)/$(NAME).c 
  102.  
  103. $(PRODUCT_ROOT)/$(NAME): $(OFILE_DIR) $(PRODUCT_DEPENDS) $(PRODUCT_ROOT)
  104.     @(if [ "`$(ECHO) $(OFILES) $(OTHER_OFILES) | wc -w`" != "       0" ] ; \
  105.     then \
  106.         cmd="$(CC) -nostdlib $(ALL_CFLAGS) -r $(PALETTELDFLAGS) -o $(PRODUCT_ROOT)/$(NAME) $(OFILES) $(OTHER_OFILES) $(OTHERLINKED)" ; \
  107.         echo $$cmd ; $$cmd ; \
  108.     else \
  109.        $(ECHO) Warning: Building empty palette. ; \
  110.        $(RM) -f $(TEMP_C_FILE) ; \
  111.        $(TOUCH) $(TEMP_C_FILE) ; \
  112.        $(CC) $(CFLAGS) $(OTHER_CFLAGS) $(RC_CFLAGS) -c $(TEMP_C_FILE) -o $(PRODUCT_ROOT)/$(NAME) ; \
  113.        $(RM) -f $(TEMP_C_FILE) ; \
  114.     fi ; \
  115.     $(CHMOD) a+x $(PRODUCT_ROOT)/$(NAME) )
  116.  
  117. $(DSTROOT)$(INSTALLDIR):
  118.     @$(MKDIRS) $(DSTROOT)$(INSTALLDIR)
  119.  
  120. before_install:: $(DSTROOT)$(INSTALLDIR)
  121.     $(RM) -rf $(DSTROOT)$(INSTALLDIR)/$(NAME).palette
  122.  
  123. after_install::
  124.  
  125. install:: palette before_install installhdrs $(OTHER_INSTALL_DEPENDS)
  126.     (cd $(SYMROOT); $(TAR) chf - $(NAME).palette) | (cd $(DSTROOT)$(INSTALLDIR); $(TAR) xf -)    
  127.     $(STRIP) $(RELOCATABLE_STRIP_OPTS) $(DSTROOT)$(INSTALLDIR)/$(NAME).palette/$(NAME)
  128.     @($(process_target_archs)_obj ; \
  129.     $(MAKE) after_install     "DSTROOT=$(DSTROOT)" \
  130.                        "OBJROOT=$(OBJROOT)" \
  131.                        "SYMROOT=$(SYMROOT)" \
  132.                 "INSTALLDIR = $(INSTALLDIR)" \
  133.                 "PRODUCT_ROOT = $(SYMROOT)/$(NAME).palette" \
  134.                 "SYM_DIR = $(SYMROOT)/sym" \
  135.                 "OFILE_DIR = $(OBJROOT)/$$obj_dir" \
  136.                 "PROJ_CFLAGS = $(NORMAL_CFLAGS)" \
  137.                 "APP_MAKEFILE_DIR = $(APP_MAKEFILE_DIR)" \
  138.                 "RC_CFLAGS = $$arch_cflags" \
  139.                 "RC_ARCHS = $$archs" )
  140.  
  141.  
  142. depend:: Makefile.dependencies $(SUBPROJECTS:.subproj=.depend) $(BUNDLES:.bproj=.depend) $(TOOLS:.tproj=.depend)
  143.  
  144.